<%@ page contentType="text/html;charset=UTF-8" language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/include/jstl.jsp" %>
<script language= "javascript "> 
    $(document).ready(function(){
        //转化日期格式
        turnDateFormat();     
    }); 
    function addhref2(obj){
        var v =document.getElementById("abcde2").value;
        if(v.length > 0){
            document.getElementById("ddd2").href = "540282.tran?type=1&RULE_CODE_CODE="+v;//放cod 
        } 
    }
    
    
    function checkS(){ 
		
    var date1 = document.getElementById("START_DATE").value;
    var date2 = document.getElementById("END_DATE").value;
    
    date1 = date1.replace("-", "").replace("-", "");
    date2 = date2.replace("-", "").replace("-", "");
    if(date1 > date2 ){
        alert("日期查询，开始日期大于结束日期！");
        return false;
    }
}
</script> 
<html>    
<body>
    <form id="pagerForm" action="540881.tran" method="post">
        <input type="hidden" name="pageNum"         value="${ETF.PAGENUM}"          />
        <input type="hidden" name="ENTITY_TYPE"     value="${ETF.ENTITY_TYPE}"      />
        <input type="hidden" name="CLIENT_CODE"     value="${ETF.CLIENT_CODE}"      />
        <input type="hidden" name="RULE_CODE_CODE"  value="${ETF.RULE_CODE_CODE}"   />
        <input type="hidden" name="RULE_CODE_NAME"  value="${ETF.RULE_CODE_NAME}"   />
        <input type="hidden" name="START_DATE"      value="${ETF.START_DATE}"       />
        <input type="hidden" name="END_DATE"        value="${ETF.END_DATE}"         />
    </form>
    <div class="pageHeader">
        <div class="searchBar">
            <form name="exceptRuleList" id="exceptRuleList" onsubmit="return navTabSearch(this)" action="540881.tran" method="post">
                <table width="100%" class="searchContent"  border="0" cellpadding="0" cellspacing="0">
                    <tr> 
                        <td>
                            客户类型:
                        </td> 
                        <td>
                            <select  name="ENTITY_TYPE" > 
                                <option value="" >--请选择--</option>
                                <option value="0" <c:if test="${ETF.ENTITY_TYPE =='0'}"> selected="selected"</c:if> >用户</option>
                                <option value="1" <c:if test="${ETF.ENTITY_TYPE =='1'}"> selected="selected"</c:if> >商户</option>                                        
                            </select>
                        </td>                           
                        <td>
                            客户编号:  
                        </td> 
                        <td>                      
                            <input type="text"  id="code" name="CLIENT_CODE" size="20" maxlength="30"   value="${ETF.CLIENT_CODE}"onkeyup= "value=value.replace(/[\ '\&]+/, '') "/>
                        </td>                      
                        <td align="right">
                            时间范围：
                        </td> 
                        <td  colspan="3" align="left">
                            <input  name="START_DATE"  id="START_DATE" format="yyyy-MM-dd"  value="${ETF.START_DATE}"  type="text"  class="date"  yearstart="-80" yearend="5" readonly="true"  size="10"/>
                            <span   class="info" >~~</span>
                            <input  name="END_DATE"  id="END_DATE" format="yyyy-MM-dd"   value="${ETF.END_DATE}"  type="text"  class="date" yearstart="-80" yearend="5" readonly="true"  size="10" />
                        </td>
                    </tr>
                    <tr>
                        <td> 
                            规则名称:
                        </td> 
                        <td align="right"  colspan="3">             
                            <div class="pageFormContent nowrap">
                                <ul>
                                    <li>
                                        <input  type="hidden" id="abcde"  name="RULE_CODE_CODE" size="40" value="${ETF.RULE_CODE_CODE}" readonly/>    
                                        <input  type="text" id="abcd"   name="RULE_CODE_NAME" size="40" value="${ETF.RULE_CODE_NAME}" readonly/>    
                                        <a class="btnLook" id="ddd" title="高级查询【选择规则名称】" href="540282.tran?EXCP_TYPE=1"  lookupGroup="orgLookup" onclick="addhref1(this.href);"/>
                                    </li>
                                </ul>
                            </div>
                        </td>         
                        <td colspan="14" align="right">
                            <div class="subBar" align="right">
                                <ul>
                                    <c:if test="${ETF.CON_BUT_DEV==0 || (ETF.CON_BUT_DEV==1 && ETF.BUT_QUERY==1)}">
                                        <li><div class="buttonActive"><div class="buttonContent"><button type="submit"   onclick="return checkS();">&nbsp;&nbsp; 查询 &nbsp;&nbsp;</button></div></div></li>
                                    </c:if>
                                </ul>
                            </div> 
                        </td>        
                    </tr>
                </table>
            </form> 
        </div>
    </div>
    <div class="pageContent">
        <div class="panelBar"></div>
            <table class="table" layoutH="158">
                <thead>
                    <tr>
                        <th width="100">日期</th>
                        <th width="100">规则编号</th>
                        <th width="330">规则名称</th>
                        <th width="100">客户类型</th>
                        <th width="180">客户编号</th>
                        <th width="100">总条数</th>
                        <th width="100">总金额(￥元)</th>
                        <th width="150">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <c:choose>
                        <c:when test="${ETF.RSPCOD=='000000'}">
                            <c:forEach items="${ETF.REC}" var="GRP">    
                                <tr target="sid_user" rel="1">               
                                <td class="dateFormatTd">${GRP.REGDT_DAY}</td>
                                <td>
                                    <div style="color:black"><a title="${GRP.RULE_CODE}"  target="navTab" href="540102.tran?RULE_CODE=${GRP.RULE_CODE}" >${GRP.RULE_CODE}</a></div>
                                </td>
                                <td>
                                    <div style="color:black">${GRP.RULE_DES}</div>
                                </td>
                                <td>
                                    <c:if test="${GRP.ENTITY_TYPE=='0'}" >用户</c:if> 
                                    <c:if test="${GRP.ENTITY_TYPE=='1'}" >商户</c:if>  
                                </td>                                      
                                <td> 
                                    <c:if test="${GRP.ENTITY_TYPE=='0'}" >${GRP.USER_CODE}</c:if>
                                    <c:if test="${GRP.ENTITY_TYPE=='1'}" >${GRP.COMP_CODE}</c:if> 
                                </td>
                                <td>
                                    <c:if test="${GRP.SUMC== null}" >--</c:if>
                                    <c:if test="${GRP.SUMC != null}" >
                                        <c:if test="${GRP.SUMC == 0}" >
                                            --
                                        </c:if>
                                        <c:if test="${GRP.SUMC != 0}" >
                                            ${GRP.SUMC}
                                        </c:if>
                                    </c:if>
                                </td>
                                <td>
                                    <c:if test="${GRP.SUMA== null}" >--</c:if>
                                    <c:if test="${GRP.SUMA != null}" >
                                        <c:if test="${GRP.SUMA == 0}" >
                                            --
                                        </c:if>
                                        <c:if test="${GRP.SUMA != 0}" >
                                            <fmt:formatNumber type="currency"  value="${GRP.SUMA/100}" pattern="0.00"/>
                                        </c:if>
                                    </c:if>
                                </td>
                                <td>
                                    <c:if test="${ETF.CON_BUT_DEV==0 || (ETF.CON_BUT_DEV==1 && ETF.BUT_LOOK==1)}">
                                        <a title="查看" target="navTab" href="540283.tran?ID=${GRP.ID}"  ><span style="color:#15428b;">详 情</span></a>
                                    </c:if>
                                    <c:if test="${ETF.CON_BUT_DEV==0 || (ETF.CON_BUT_DEV==1 && ETF.BUT_OK==1)}">
                                        <!--a title="返回为异常交易"
                                            <c:if test="${GRP.EXCEPT_TRAN_FLAG=='1'}">style="display:none;"</c:if> 
                                                target="ajaxTodo" href="540884.tran?ID=${GRP.ID}&EXCEPT_TRAN_FLAG=0"
                                                class="btnSelect" >确认</a-->
                                       | <a title="返回为异常交易"
                                            <c:if test="${GRP.EXCEPT_TRAN_FLAG=='1'}">style="display:none;"</c:if> 
                                                target="navTab" href="sustranAtion.tran?ID=${GRP.ID}&EXCEPT_TRAN_FLAG=0"
                                                ><span style="color:#15428b;">确 认</span></a>
                                    </c:if>
                                    <c:if test="${ETF.CON_BUT_DEV==0 || (ETF.CON_BUT_DEV==1 && ETF.BUT_RELEASE==1)}">
                                        <!--a title="释放为正常交易"
                                            <c:if test="${GRP.EXCEPT_TRAN_FLAG=='1'}">style="display:none;"</c:if> 
                                            target="ajaxTodo" href="540884.tran?ID=${GRP.ID}&EXCEPT_TRAN_FLAG=2"
                                            class="btnDel" >释放</a-->
                                       | <a title="释放为正常交易"
                                            <c:if test="${GRP.EXCEPT_TRAN_FLAG=='1'}">style="display:none;"</c:if> 
                                            target="navTab" href="sustranAtion.tran?ID=${GRP.ID}&EXCEPT_TRAN_FLAG=2"
                                            ><span style="color:#15428b;">释 放</span></a>
                                    </c:if>
                                </td>
                            </tr>
                        </c:forEach>
                    </c:when>
                    <c:otherwise>
                        <tr>
                            <td>没有符合条件的记录</td>
                        </tr>
                    </c:otherwise>
                </c:choose>
            </tbody>
        </table>
        <div class="panelBar">
        	  <ul class="toolBar">
               <li>
                 <a class="icon" href="abnormaltrans.tran?EXCEPT_TRAN_FLAG=1&ENTITY_TYPE=${ETF.ENTITY_TYPE}&USER_CODE=${ETF.USER_CODE}&START_DATE=${ETF.START_DATE}&END_DATE=${ETF.END_DATE}&RULE_CODE_CODE=${ETF.RULE_CODE_CODE}" 
                           target="dwzExport" targetType="navTab" title="确定导出这些记录吗?"><span>导出EXCEL</span></a>
               </li>
            </ul>
            <div class="pages">
                <span>共[${ETF.TOLCNT}]条,每页显示${ETF.NUMPERPAGE}条,当前第
                <c:choose>
                    <c:when test="${ETF.TOLCNT==0}">0</c:when>
                    <c:when test="${ETF.TOLCNT>0&&ETF.TOLCNT<=ETF.NUMPERPAGE}">1-${ETF.TOLCNT}</c:when>  
                    <c:otherwise>
                        <c:choose>
                            <c:when test="${(ETF.PAGENUM-1)*ETF.NUMPERPAGE+1>ETF.TOLCNT}">${ETF.STARTINDEX}</c:when><c:otherwise>${(ETF.PAGENUM-1)*ETF.NUMPERPAGE+1}</c:otherwise>
                        </c:choose>
                        -
                        <c:choose>                     
                            <c:when test="${ETF.PAGENUM*ETF.NUMPERPAGE>=ETF.TOLCNT}">${ETF.TOLCNT}</c:when>           
                            <c:otherwise>${ETF.PAGENUM*ETF.NUMPERPAGE}</c:otherwise>                 
                        </c:choose>
                    </c:otherwise>                
                </c:choose>
                条</span>
            </div>             
            <div class="pagination" targetType="navTab" totalCount="${ETF.TOLCNT}" numPerPage="${ETF.NUMPERPAGE}" pageNumShown="${ETF.PAGENUMSHOWN}" currentPage="${ETF.PAGENUM}"></div>
        </div>
    </div>     
</body>
</html>
